{% extends "base.html" %}
{% block content_title %}{% endblock %}
{% block ogtitle %}{{ SITENAME }}{% endblock %}
{% block ogurl %}{{ SITEURL }}{%endblock%}
{% block canonicalurl %}{{ SITEURL }}{%endblock%}

{% block content %}
<div class="span9">
    {% if articles %}
        {% for article in articles_page.object_list %}
            {% if loop.length > 0 %}
                {% if loop.first %}
                <section>
                    <ol id="posts-list" class="hfeed" start="{{ articles_paginator.per_page -1 }}">
                {% endif %}
                    <li>
                        <article>
                            <header>
                                <h1 class="entry-title">
                                    <a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags }}">
                                       {{ article.title }}
                                    </a>
                                </h1>
                            </header>
                            <div class="entry-content">
                                {% include 'article_infos.html' %}
                                {{ article.summary }}
                                <p class="readmore">
                                    <a class="btn btn-small btn-info" href="{{ SITEURL }}/{{ article.url }}">Read more...</a>
                                </p>
                            </div><!-- /.entry-content -->
                            <hr/>
                        </article>
                    </li>
                {% if loop.last %}
                    </ol><!-- /#posts-list -->
                    {% if loop.last and (articles_page.has_previous()
                    or not articles_page.has_previous() and loop.length > 1) %}
                        {% include 'pagination.html' %}
                    {% endif %}
                </section><!-- /#content -->
                {% endif %}
            {% endif %}
        {% endfor %}
    {% else %}
    <section  >
    <h2>Pages</h2>
        {% for page in PAGES %}
            <li><a href="{{ SITEURL }}/{{ page.url }}">{{ page.title }}</a></li>
        {% endfor %}
    </section>
    {% endif %}
</div>
{% endblock content %}

{% block sidebar %}
<div class="span3">
    <section id="sidebar">
            <div>
                <h2>Browse content by</h2>
                <ul class="fa-ul">
                <li><a href="{{ SITEURL }}/{{ CATEGORIES_SAVE_AS|default('categories.html') }}"><i class="fa-li fa fa-tags"></i> Categories</a></li>
                <li><a href="{{ SITEURL }}/{{ ARCHIVES_SAVE_AS|default('archives.html') }}"><i class="fa-li fa fa-calendar"></i> Dates</a></li>
                <li><a href="{{ SITEURL }}/{{ TAGS_SAVE_AS|default('tags.html') }}"><i class="fa-li fa fa-tag"></i> Tags</a></li>

              {% if TAG_FEED_ATOM and tag is defined %}
                <li><a href="{{ FEED_DOMAIN }}/{{ TAG_FEED_ATOM|format(tag.slug) }}"><i class="fa-li fa fa-rss"></i> Feed</a></li>
              {% elif TAG_FEED_RSS and tag is defined %}
                <li><a href="{{ FEED_DOMAIN }}/{{ TAG_FEED_RSS|format(tag.slug) }}"><i class="fa-li fa fa-rss"></i> Feed</a></li>
              {% elif CATEGORY_FEED_ATOM and category is defined %}
                <li><a href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_ATOM|format(category.slug) }}"><i class="fa-li fa fa-rss"></i> Feed</a></li>
              {% elif CATEGORY_FEED_RSS and category is defined %}
                <li><a href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_RSS|format(category.slug) }}"><i class="fa-li fa fa-rss"></i> Feed</a></li>
              {% elif FEED_ALL_ATOM %}
                <li><a href="{{ FEED_DOMAIN }}/{{ FEED_ALL_ATOM }}"><i class="fa-li fa fa-rss"></i> Feed</a></li>
              {% elif FEED_ALL_RSS %}
                <li><a href="{{ FEED_DOMAIN }}/{{ FEED_ALL_RSS }}"><i class="fa-li fa fa-rss"></i> Feed</a></li>
              {% endif %}
                </ul>
            </div><!-- /.browse -->
    {% if LINKS %}
            <div>
                <h2>Links</h2>
                <ul>
                {% for name, link in LINKS %}
                    <li><a href="{{ link }}">{{ name }}</a></li>
                {% endfor %}
                </ul>
            </div><!-- /.Links -->
    {% endif %}
    {% if SOCIAL %}
            <div>
                <h2>Social</h2>
                <ul>
                {% for name, link in SOCIAL %}
                    <li><a href="{{ link }}">{{ name }}</a></li>
                {% endfor %}
                </ul>
            </div><!-- /.social -->
    {% endif %}
    {% if TAG_CLOUD_STEPS %}
            <div>
                <h2>Tags</h2>
                <ul id="cloud">
                     {% for tag in tag_cloud %}
                     <li class="tag-{{ tag.1 }}"><a href="{{ SITEURL }}/{{ tag.0.url }}">{{ tag.0 }}</a></li>
                     {% endfor %}
                </ul>
             </div>
    {% endif %}<!-- /.Tags -->
    </section><!-- /#sidebar -->
</div>
{% endblock %}
